package com.baidu.aip;

import com.baidu.aip.ocr.AipOcr;
import org.json.JSONObject;

import java.util.HashMap;

public class Sample {
    public static void main(String[] args) {
    }
    public static void openBaiDuAip(String APP_ID,String API_KEY,String SECRET_KEY){
        // 初始化一个AipOcr
        AipOcr client = new AipOcr(APP_ID, API_KEY, SECRET_KEY);
        // 传入可选参数调用接口
        HashMap<String, String> options = new HashMap<String, String>();
        options.put("detect_direction", "true");
        options.put("probability", "true");
        options.put("language_type","ENG");
        // 参数为本地图片路径
        String image = "E:\\公司文件夹二\\垃圾模板\\【版137】玻璃钢仿真红军摆件\\不锈钢仿真红军\\SKU\\B-JR1001.jpg";
        JSONObject res = client.basicAccurateGeneral(image, options);
        System.out.println(res.toString(2).trim());
    }
}
